package com.example.sildingfinishdemo.SlidingFinishView;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;

import com.example.sildingfinishdemo.R;

/**
 * 想要实现向右滑动删除Activity效果只需要继承SlidingFinishActivity即可，如果当前页面含有ViewPager
 * 只需调用SwipeBackLayout的setViewPager()方法即可
 * 设置AndroidManifest.xml　activity　主题
 *  * <activity>
 *  * android:theme="@android:style/Theme.Translucent.NoTitleBar"
 *  * </activity>
 */
public class SlidingFinishActivity extends Activity {

    protected SlidingFinishLayout layout;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        layout = (SlidingFinishLayout)LayoutInflater.from(this).inflate(R.layout.base,null);
        layout.attchToActivity(this);
    }

    @Override
    public void startActivity(Intent intent) {
        super.startActivity(intent);
        overridePendingTransition(R.anim.base_slide_right_in,R.anim.base_slide_remain);
    }

    @Override
    public void onBackPressed() {
        super.onBackPressed();
        overridePendingTransition(0, R.anim.base_slide_right_out);
    }
}

